﻿using System.Collections;
using System.Collections.Generic;
using INTEX.DataBase.Tools;
using ReflectionStudio.Core;
using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.IO;
using WPFExcelReport.Helpers;
namespace WPFExcelReport
{
   
    public partial class ITXEXRPT
    {
        
        public string SJHPrint(ref bool IsReturn)
        {
            if (app.company != "SJH")
                return filename;
            Helper.GetDate(ref date, ref year, ref month, ref day);
            switch (DocType)
            {
                #region=SJH====

                case "SJHWBLABLE":
                    destfolder = SetFolder(Root, "验布标签");
                    #region====文件命名==============
                    order = date;
                    DestFile = destfolder + "\\验布标签-" + date + DateTime.Today.Hour + DateTime.Today.Minute + DateTime.Today.Second + ".xls";
                    #endregion
                    #region=====空白文档=======
                    Standard = "SJHWBLABLE";
                    exAgent.CreateNewSheet(temp + ".xls", Standard);
                    tempfile = exAgent.FileName;
                    #endregion
                    SJHWBLABLE(dsSource);
                    break;
                case "SJHSHIFTPROD":
                    destfolder = SetFolder(Root, "班次产量");
                    #region====文件命名==============
                    order = date;
                    DestFile = destfolder + "\\班次产量-" + date + DateTime.Today.Hour + DateTime.Today.Minute + DateTime.Today.Second + ".xls";
                    #endregion
                    #region=====空白文档=======
                    Standard = "SJHSHIFTPROD";
                    exAgent.CreateNewSheet(temp + ".xls", Standard);
                    tempfile = exAgent.FileName;
                    #endregion
                    SJHSHIFTPROD(dsSource);
                    break;
                case "SJHWVRPOINT":
                    destfolder = SetFolder(Root, "挡车工扣分");
                    #region====文件命名==============
                    order = date;
                    DestFile = destfolder + "\\挡车工扣分-" + date + DateTime.Today.Hour + DateTime.Today.Minute + DateTime.Today.Second + ".xls";
                    #endregion
                    #region=====空白文档=======
                    Standard = "SJHWVRPOINT";
                    exAgent.CreateNewSheet(temp + ".xls", Standard);
                    tempfile = exAgent.FileName;
                    #endregion
                    SJHWVRPOINT(dsSource);
                    break;
                case "SJHPRODA":
                    destfolder = SetFolder(Root, "织造车间A级率统计");
                    #region====文件命名==============
                    order = date;
                    DestFile = destfolder + "\\织造车间A级率统计-" + date + DateTime.Today.Hour + DateTime.Today.Minute + DateTime.Today.Second + ".xls";
                    #endregion
                    #region=====空白文档=======
                    Standard = "SJHPRODA";
                    exAgent.CreateNewSheet(temp + ".xls", Standard);
                    tempfile = exAgent.FileName;
                    #endregion
                    SJHPRODA(dsSource);
                    break;
                case "SJWVZNPROD":
                    destfolder = SetFolder(Root, "车间产量");
                    #region====文件命名==============
                    order = date;
                    DestFile = destfolder + "\\车间产量-" + date + DateTime.Today.Hour + DateTime.Today.Minute + DateTime.Today.Second + ".xls";
                    #endregion
                    #region=====空白文档=======
                    Standard = "SJWVZNPROD";
                    exAgent.CreateNewSheet(temp + ".xls", Standard);
                    tempfile = exAgent.FileName;
                    #endregion
                    SJWVZNPROD(dsSource);
                    break;
                case "SJYBWB13":
                    destfolder = SetFolder(Root, "验布产量");
                    #region====文件命名==============
                    order = date;
                    DestFile = destfolder + "\\验布产量-" + date + DateTime.Today.Hour + DateTime.Today.Minute + DateTime.Today.Second + ".xls";
                    #endregion
                    #region=====空白文档=======
                    Standard = "SJYBWB13";
                    exAgent.CreateNewSheet(temp + ".xls", Standard);
                    tempfile = exAgent.FileName;
                    #endregion
                    SJYBWB13(dsSource);
                    break;
                case "SJHWVPROD":
                    destfolder = SetFolder(Root, "织造产量");
                    #region====文件命名==============
                    order = date;
                    DestFile = destfolder + "\\织造产量-" + date + DateTime.Today.Hour + DateTime.Today.Minute + DateTime.Today.Second + ".xls";
                    #endregion
                    #region=====空白文档=======
                    Standard = "SJHWVPROD";
                    exAgent.CreateNewSheet(temp + ".xls", Standard);
                    tempfile = exAgent.FileName;
                    #endregion
                    SJHWVPROD(dsSource);
                    break;
                case "SJQIPRA":
                    destfolder = SetFolder(Root, "每日A级率");
                    #region====文件命名==============
                    order = date;
                    DestFile = destfolder + "\\每日A级率-" + date + DateTime.Today.Hour + DateTime.Today.Minute + DateTime.Today.Second + ".xls";
                    #endregion
                    #region=====空白文档=======
                    Standard = "SJQIPRA";
                    exAgent.CreateNewSheet(temp + ".xls", Standard);
                    tempfile = exAgent.FileName;
                    #endregion
                    SJQIPRA(dsSource);
                    break;
                case "SJDWB13":
                    destfolder = SetFolder(Root, "每日产量");
                    #region====文件命名==============
                    order = date;
                    DestFile = destfolder + "\\每日产量-" + date + DateTime.Today.Hour + DateTime.Today.Minute + DateTime.Today.Second + ".xls";
                    #endregion
                    #region=====空白文档=======
                    Standard = "SJDWB13";
                    exAgent.CreateNewSheet(temp + ".xls", Standard);
                    tempfile = exAgent.FileName;
                    #endregion
                    SJDWB13(dsSource);
                    break; 
                    #endregion
            }
            return filename;
        }

    }
}
